﻿using Cl.Utils.Helper.AutoMap;
using Cl.Utils.Primitives.Const.Goods;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Cl.Model.DataBaseEntityDtos.Goods.BaseGoods
{
    public class BaseGoodsOutputDto
    {
        public BaseGoodsOutputDto() { }

        public BaseGoodsOutputDto(Entity.DataBaseEntity.Goods.BaseGoods info)
        {
            //自动映射到当前对象
            AutoMapHelper.MapTo(info, this);
            if (info.AuditState != null && info.AuditState == ProductStateConst.Online) State = 1;
            else State = 0;
        }

        public int State { get; set; }
        public int Id { get; set; }
        public int ShopId { get; set; }

        public int GroupId { get; set; }

        public string Title { get; set; } = string.Empty;

        public string Description { get; set; } = string.Empty;

        /// <summary>
        /// 原材料
        /// </summary>
        public string RawMaterial { get; set; } = string.Empty;

        public string Cover { get; set; } = string.Empty;

        /// <summary>
        /// 单价
        /// </summary>
        public decimal Price { get; set; }

        /// <summary>
        /// 库存量
        /// </summary>
        public int Quantity { get; set; }


        public DateTime AuditTime { get; set; }

        public int AuditUserId { get; set; }

        /// <summary>
        /// 管理员审批后可以正常使用
        /// </summary>
        public string AuditState { get; set; } = string.Empty;

        public string AuditStateTxt { get; set; } = string.Empty;

        public string AuditRemark { get; set; } = string.Empty;

        public DateTime CreateTime { get; set; }
    }
}
